import http from '@/utils/httpUtils'

/**
 * @单词分页条件查询
 */
export function getWordsPage(query){
    return http("/system/word/wordPage","post",query);
}

/**
 * @新增单词
 */
export function addWordsApi(query){
    return http('/system/word/addWord','post',query)
}

/**
 * @修改单词
 */
export function updateWordsApi(query){
    return http('/system/word/updateWord','post',query)
}

/**
 * @单词考试开始
 */
export function startWords(query){
    return http("/system/word/wordStart","post",query);
}

/**
 * @单词考试结束
 */
export function endWords(query){
    return http("/system/word/wordEnd","post",query)
}

/**
 * @删除单词
 */
export function deleteWord(wordId){
    return http(`/system/word/deleteWord/${wordId}`,'delete')
}

/**
 * @检查单词录音文件是否存在
 */
export function isExist(fileId){
    return http(`/system/word/isExist/${fileId}`,'get')
}

/**
 * @添加日语课程
 */
export function addCourseApi(query){
    return http('/system/word/course/addCourse','post',query);
}

/**
 * @查询课程树
 */
export function getCourseTreeApi(){
    return http('/system/word/course/courseTree','get')
}

/**
 * @修改课程
 */
export function updateCourseApi(query){
    return http('/system/word/course/updateCourse','post',query)
}

/**
 * @删除课程
 */
export function deleteCourseApi(id){
    return http(`/system/word/course/deleteCourse/${id}`,'delete')
}

/**
 * @添加语法
 */
export function addGrammarApi(query){
    return http('/system/word/grammar/addGrammar','post',query)
}

/**
 * @语法分页查询
 */
export function grammarPageApi(query){
    return http('/system/word/grammar/grammarPage','get',query)
}

/**
 * @修改语法
 */
export function updateGrammarApi(query){
    return http('/system/word/grammar/updateGrammar','post',query)
}

/**
 * @删除语法
 */
export function deleteGrammarApi(id){
    return http(`/system/word/grammar/deleteGrammar/${id}`,'delete')
}

/**
 * @获取考试记录
 */
export function getWordResult(qry){
    return http(`/system/word/wordResult`,'post',qry);
}

/**
 * @查询错误的单词
 */
export function getErrorWords(id){
    return http(`/system/word/errorWords/${id}`,'get')
}

/**
 * @补考
 */
export function wordReviver(id){
    return http(`/system/word/wordReviver/${id}`,'get')
}